package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-11-26  22:17
 */
public class Test2 {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
//        for(int i = 0; i < array.length; i++) {
//            System.out.print(array[i] + " ");
//            System.out.print(i + " ");
//        }
        for(int j = array.length - 1; j >= 0; j--) {
            System.out.print(array[j] + " ");
            System.out.print(j + " ");
        }
        System.out.println();
        for(int j = array.length - 1; j >= 0; --j) {
            System.out.print(array[j] + " ");
            System.out.print(j + " ");
        }
    }
}
